package com.lixinwen.hallserver.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lixinwen.hallserver.dao.RoomMapper;
import com.lixinwen.hallserver.pojo.Room;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class HallService {

    @Autowired
    RoomMapper roomMapper;

    public Long getOneEmpty(){
        QueryWrapper<Room> wrapper = new QueryWrapper<>();
        wrapper.eq("status",false );
        Room roomState = roomMapper.selectOne(wrapper);
        roomState.setStatus(true);
        roomMapper.updateById(roomState);
        return roomState.getId();
    }
}
